Skip to content

Authentication State Doesn't Persist Through Page Refresh #1

Closed
@MoonKraken

Description

@MoonKraken

First of all thank you for yew-oauth2 - having oauth in Rust webapps is amazing.

It seems like the access/refresh tokens are stored in an OAuth2Context object that can be retrieved by child components of <OAuth2>. Consequently, auth state seems to be lost when the page is refreshed.

I'm not an expert in auth flows, but wouldn't storing the access token in a cookie be preferable? Both to resolve this issue and because it's likely all or most requests to backend APIs will need to include the access token anyway.

I suppose that would make this crate a bit "opinionated" in that some developers might want to handle this a different way. What's your recommended approach for handling this given how the crate works today?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions