Skip to content

Commit

Permalink
Add needs login method
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangSenff authored Mar 19, 2024
1 parent c2b0c73 commit 2e2c302
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions addons/godot-firebase/auth/auth.gd
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ func logout() -> void:
remove_auth()
logged_out.emit()

# Checks to see if we need a hard login
func needs_login() -> bool:
var encrypted_file = FileAccess.open_encrypted_with_pass("user://user.auth", FileAccess.READ, _config.apiKey)
var err = encrypted_file == null
return err

# Function is called when requesting a manual token refresh
func manual_token_refresh(auth_data):
Expand Down

0 comments on commit 2e2c302

Please sign in to comment.