all files / collab/ ServerRequest.js

0% Statements 0/9
100% Branches 0/0
0% Functions 0/4
0% Lines 0/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33                                                                 
class ServerRequest {
  constructor(message, ws) {
    this.message = message
    this.ws = ws
    this.isAuthenticated = false
    this.isAuhorized = false
  }
 
  /*
    Marks a request as authenticated
  */
  setAuthenticated(session) {
    this.isAuthenticated = true
    this.session = session
  }
 
  /*
    Marks a request as authorized (authorizationData is optional)
  */
  setAuthorized(authorizationData) {
    this.isAuthorized = true
    this.authorizationData = authorizationData
  }
 
  /*
    Sets the isEnhanced flag
  */
  setEnhanced() {
    this.isEnhanced = true
  }
}
 
export default ServerRequest