mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Refresh the page if the user is not logged in when joining a project
This commit is contained in:
parent
345d38c28d
commit
daf8f6f3cf
1 changed files with 10 additions and 0 deletions
|
@ -103,6 +103,16 @@ define [], () ->
|
|||
@ide.socket.emit 'joinProject', {
|
||||
project_id: @ide.project_id
|
||||
}, (err, project, permissionsLevel, protocolVersion) =>
|
||||
if err?
|
||||
if err.message == "not authorized"
|
||||
window.location = "/login?redir=#{encodeURI(window.location.pathname)}"
|
||||
else
|
||||
@ide.socket.disconnect()
|
||||
@ide.showGenericMessageModal("Something went wrong connecting", """
|
||||
Something went wrong connecting to your project. Please refresh is this continues to happen.
|
||||
""")
|
||||
return
|
||||
|
||||
if @$scope.protocolVersion? and @$scope.protocolVersion != protocolVersion
|
||||
location.reload(true)
|
||||
|
||||
|
|
Loading…
Reference in a new issue